import { getVideoUrl, getVideoInfo, getRelatedVideo } from "../../service/request/video";
// pages/videoDetail/videoDetail.js
Page({
  data: {
    id: -1,
    url: '',
    videoInfo: {}
    
  },
  onLoad: function(option) {
    // console.log(option.id);
    const id = option.id
    this.setData({id})
    this.fetchVideoUrl()
    this.fetchVideoInfo()
    this.fetchRelatedVideo()
  },
  // 获取MVurl
  fetchVideoUrl() {
    getVideoUrl(this.data.id).then((res) => {
      // console.log(res.data);
      this.setData({url: res.data.url})
    })
  },
  // 获取MV信息
  fetchVideoInfo() {
    getVideoInfo(this.data.id).then((res) => {
      // console.log(res.data);
      this.setData({videoInfo: res.data})
    })
  },
  // 获取MV关联视频
  fetchRelatedVideo() {
    getRelatedVideo(this.data.id).then((res) => {
      // console.log(res);
    })
  }
})